package nil.ed.livechat.timeshift.sync.common;

import lombok.Getter;

import java.io.File;
import java.util.concurrent.TimeUnit;

/**
 * @author delin10
 * @since 2020/6/26
 **/
@Getter
public class ConfigContext {

    private String tsTmpDir = System.getProperty("user.home") + "/ts___ts___ts" + System.currentTimeMillis();

    private String base = "/root/data/livechat/vc/hls";

    private long maxIdleTime = TimeUnit.MINUTES.toMillis(5);

    {
        File f = new File(tsTmpDir);
        if (!f.exists()) {
            if (!f.mkdirs()) {
                // ignore todo log some error
            }
        }
        f.deleteOnExit();
    }
}
